trigger QCOpportunityTrigger on Opportunity (after update) 
{
    List<Fulfillment_Task__c> tasks = new List<Fulfillment_Task__c>();
    
    for(Opportunity opp : Trigger.new) 
    {       
        try
        {    
              if((opp.StageName == 'Contract - In Fulfillment') &&
                        (opp.StageName !=  System.Trigger.oldMap.get(opp.Id).StageName))
            {
                Fulfillment_Task__c task = new Fulfillment_Task__c();
                                
                task.RecordTypeId = RecordTypeHelper.GetRecordTypeID('Fulfillment_Task__c', 'Quality Control');
                task.Opportunity__c = opp.Id;
                tasks.add(task);
            }       
        }
        catch(Exception e) 
        {      
            CommonUtils.SendErrorNotification(e);  
        }      
            
    }
    
    try
    {
        insert tasks;
    }
    catch(Exception e) 
    {      
        CommonUtils.SendErrorNotification(e);  
    }      
}